Skip to content

fix: grid plotting for unstructured mesh#152

Merged
henry2004y merged 3 commits into
masterfrom
fix-plotgrid
May 4, 2026
Merged

fix: grid plotting for unstructured mesh#152
henry2004y merged 3 commits into
masterfrom
fix-plotgrid

Conversation

@henry2004y

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors plotting and utility functions to handle data dimensions dynamically by replacing hardcoded indexing with ndims and selectdim. It also adds a new test case for unstructured 2D cuts. Feedback suggests improving consistency in the tripcolor function by using selectdim for variable slicing, aligning it with the changes made to other functions in the module.

Comment thread ext/BatsrusPyPlotExt/pyplot.jl
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown

Benchmark Results (Julia v1)

Time benchmarks
master 9767c76... master / 9767c76...
amrex/load 25.5 ± 0.52 μs 25.5 ± 0.49 μs 1 ± 0.028
amrex/phase_space_3d 6.12 ± 1.3 ms 6.02 ± 1 ms 1.02 ± 0.27
amrex/select_region 0.223 ± 0.013 ms 0.224 ± 0.013 ms 0.996 ± 0.081
amrex/select_region_from_files 0.857 ± 0.14 ms 1.75 ± 0.24 ms 0.491 ± 0.11
read/ASCII 0.662 ± 0.013 ms 0.656 ± 0.014 ms 1.01 ± 0.029
read/Anisotropy 31.3 ± 1.5 μs 31.1 ± 1.5 μs 1 ± 0.067
read/Anisotropy Symbol 31.2 ± 2.5 μs 30.9 ± 1.7 μs 1.01 ± 0.099
read/Cutdir 2.25 ± 0.15 μs 2.24 ± 0.16 μs 1 ± 0.098
read/Cutdir subset 3.11 ± 0.2 μs 3.12 ± 0.19 μs 0.997 ± 0.089
read/Extract Bmag 0.631 ± 0.15 μs 0.652 ± 0.12 μs 0.968 ± 0.29
read/HDF5 0.108 ± 0.0022 ms 0.11 ± 0.0026 ms 0.981 ± 0.031
read/HDF5 extract 13.7 ± 0.6 μs 14 ± 0.62 μs 0.977 ± 0.061
read/Interp2d 0.861 ± 0.21 μs 0.851 ± 0.2 μs 1.01 ± 0.34
read/Load binary structured 0.0431 ± 0.0023 ms 0.0429 ± 0.0017 ms 1 ± 0.067
time_to_load 1.2 ± 0.0021 s 1.2 ± 0.0063 s 0.998 ± 0.0055
Memory benchmarks
master 9767c76... master / 9767c76...
amrex/load 0.212 k allocs: 9.67 kB 0.212 k allocs: 9.67 kB 1
amrex/phase_space_3d 0.059 k allocs: 18.3 MB 0.059 k allocs: 18.3 MB 1
amrex/select_region 3 allocs: 1.07 MB 3 allocs: 1.07 MB 1
amrex/select_region_from_files 0.05 k allocs: 7.48 MB 0.05 k allocs: 7.48 MB 1
read/ASCII 0.505 k allocs: 0.112 MB 0.505 k allocs: 0.112 MB 1
read/Anisotropy 3 allocs: 4.84 kB 3 allocs: 4.84 kB 1
read/Anisotropy Symbol 3 allocs: 4.84 kB 3 allocs: 4.84 kB 1
read/Cutdir 0.137 k allocs: 5.98 kB 0.137 k allocs: 5.98 kB 1
read/Cutdir subset 0.159 k allocs: 8.89 kB 0.159 k allocs: 8.89 kB 1
read/Extract Bmag 3 allocs: 4.09 kB 3 allocs: 4.09 kB 1
read/HDF5 0.1 k allocs: 3.67 kB 0.1 k allocs: 3.67 kB 1
read/HDF5 extract 17 allocs: 4.55 kB 17 allocs: 4.55 kB 1
read/Interp2d 12 allocs: 4.45 kB 12 allocs: 4.45 kB 1
read/Load binary structured 0.241 k allocs: 0.0757 MB 0.241 k allocs: 0.0757 MB 1
time_to_load 0.149 k allocs: 11.1 kB 0.149 k allocs: 11.1 kB 1

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.30%. Comparing base (1865481) to head (9767c76).

Files with missing lines Patch % Lines
ext/BatsrusPyPlotExt/pyplot.jl 82.35% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
+ Coverage   81.09%   81.30%   +0.21%     
==========================================
  Files          20       20              
  Lines        3581     3590       +9     
==========================================
+ Hits         2904     2919      +15     
+ Misses        677      671       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@henry2004y henry2004y merged commit 1f55a43 into master May 4, 2026
8 checks passed
@henry2004y henry2004y deleted the fix-plotgrid branch May 4, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant